package org.campuscontent.ui;

import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.ImageIcon;


import org.campuscontent.config.Config;
import org.campuscontent.main.MainFrame;

public class Template16 extends TemplateBase
{
	public static int paraID = 16;
	JLabel picture;
	
	public Template16( MainFrame mf )
	{
		super(mf);
	
		//Set up the picture label and put it in a scroll pane.
        ImageIcon firstImage = new ImageIcon(this.getClass().getResource("/org/campuscontent/images/toolbar/Flaschensortierung.png"));
            picture = new JLabel(firstImage);
       
		JScrollPane scrollPane = new JScrollPane(picture);

		scrollPane.setBounds(0,0,363,244);
		picture.setBounds(170,0,363,244);
//		left.add(labelMatch);
		left.add(picture);
	}


	public void initView()
	{
//		mf.rootPanel.setDividerLocation(Config.POSITION_TO_SHOW_TEMPLATE_WITH_PICTURE);
//		this.setDividerLocation(Config.POSITION_TO_HIDE_PROBLEM_CONTROLS);
	}

	public String getAnswer()
	{
		return "";
	}
	
	public boolean setPreview()
	{
		if (!super.setPreview()) return false;
		this.setDividerLocation(Config.POSITION_TO_SHOW_PROBLEM_CONTROLS);
		mf.rootPanel.setDividerLocation(Config.POSITION_TO_SHOW_TEMPLATE_WITH_PICTURE);
		mf.problemCtrl.exitPreview.setBounds(2, 300, 135, 30);

		return true;
	}

	public boolean exitPreview()
	{
		super.exitPreview();
		mf.problemCtrl.exitPreview.setBounds(2, 430, 135, 30);
		return true;
	}

	public String checkAns()
	{
		return "";
	}

	public void showSolution()
	{
		super.showSolution();
	}
	
	public boolean updateToLObjectNew()
	{
//		//first check if the user have set the 
//		sAnswer = getAnswer();
//		if (sAnswer.equals("none#none#none#none#"))
//		{
//			JOptionPane.showMessageDialog(getWindowForComponent(mf.applet), "You should set the answer!");
//			return false;
//		} else
		{
			super.updateToLObjectNew();
			return true;
		}
	}
	public int getId()
	{
		return paraID;
	}
	

	
}
